Плохо! Плохо!:  0
Показано с 1 по 1 из 1

Тема: [MZ] Phileas_NameInputWindowRectSettings

  1. #1
    Бывалый Аватар для Phileas
    Информация о пользователе
    Регистрация
    05.02.2016
    Адрес
    HD 128620, HR 5459, CP−60°5483, GCTP 3309.00A, LHS 50
    Сообщений
    628
    Записей в дневнике
    26
    Репутация: 23 Добавить или отнять репутацию

    По умолчанию [MZ] Phileas_NameInputWindowRectSettings

    Название плагина: Phileas_NameInputWindowRectSettings

    Автор: Phileas

    Версия: 1.0.0 для MZ

    Дата выхода:
    1.0.0 - 09.08.2023

    Описание плагина:
    Позволяет задать пользовательские размеры и координаты окна ввода имени.

    Использование плагина:
    Если значение параметра меньше 1, устанавливается стандартное значение.

    Как это выглядит:




    Код:
    Спойлер Версия 1.0.0:
    Код:
    //=============================================================================
    // Phileas_NameInputWindowRectSettings.js
    //=============================================================================
    // [Update History]
    // 2023.August.9 Ver1.0.0 First Release
    
    /*:
     * @target MZ
     * @plugindesc Allows you to set custom name input window sizes and coordinates.
     * @author Phileas
     *
     * @param nameWindowWidth
     * @text Name window width (top window)
     * @type number
     * @default 0
     *
     * @param nameWindowHeight
     * @text Name window height (top window)
     * @type number
     * @default 0
     *
     * @param inputWindowWidth
     * @text Input window width (bottom window)
     * @type number
     * @default 0
     *
     * @param inputWindowHeight
     * @text Input window height (bottom window)
     * @type number
     * @default 0
     *
     * @param windowX
     * @text X coordinate
     * @desc X coordinate of the upper-left corner of the window.
     * @type number
     * @default 0
     *
     * @param windowY
     * @text Y coordinate
     * @desc Y coordinate of the upper-left corner of the window.
     * @type number
     * @default 0
     *
     * 
     * @help
     * [Summary]
     * If the value of the parameter is less than 1, then the default value is set.
     *
     * [License]
     * This plugin is released under MIT license.
     * http://opensource.org/licenses/mit-license.php
     *
     * This means that you can freely use the plugin in non-commercial and commercial games and even edit it.
     * But be sure to include me in the credits!
     */
     
    /*:ru
     * @target MZ
     * @plugindesc Позволяет задать пользовательские размеры и координаты окна ввода имени.
     * @author Phileas
     *
     * @param nameWindowWidth
     * @text Ширина окна имени (верхнее окно)
     * @type number
     * @default 0
     *
     * @param nameWindowHeight
     * @text Высота окна имени (верхнее окно)
     * @type number
     * @default 0
     *
     * @param inputWindowWidth
     * @text Ширина окна ввода (нижнее окно)
     * @type number
     * @default 0
     *
     * @param inputWindowHeight
     * @text Высота окна ввода (нижнее окно)
     * @type number
     * @default 0
     *
     * @param windowX
     * @text X coordinate
     * @desc X-координата верхнего левого угла окна
     * @type number
     * @default 0
     *
     * @param windowY
     * @text Y coordinate
     * @desc Y-координата верхнего левого угла окна
     * @type number
     * @default 0
     *
     * 
     * @help
     * [Summary]
     * Если значение параметра меньше 1, устанавливается стандартное значение.
     *
     * [License]
     * Этот плагин распространяется по лицензии MIT.
     * http://opensource.org/licenses/mit-license.php
     *
     * Это означает, что вы можете свободно использовать плагин в некоммерческих и коммерческих играх и даже редактировать его.
     * Но обязательно укажите меня в титрах!
     */
    
    (function() {
    
    //--------DATA:
        var parameters = PluginManager.parameters("Phileas_NameInputWindowRectSettings");
        var nameWindowWidth = Number(parameters["nameWindowWidth"] || 0);
        var nameWindowHeight = Number(parameters["nameWindowHeight"] || 0);
        var inputWindowWidth = Number(parameters["inputWindowWidth"] || 0);
        var inputWindowHeight = Number(parameters["inputWindowHeight"] || 0);
        var windowX = Number(parameters["windowX"] || 0);
        var windowY = Number(parameters["windowY"] || 0);
    
    //--------CHANGED CORE:
    
        function calculateSize(defaultValue, plaginValue) {
            if (plaginValue < 1) {
                return defaultValue;
            }
            
            return plaginValue;
        }
    
        Origin_editWindowRect = Scene_Name.prototype.editWindowRect;
        Scene_Name.prototype.editWindowRect = function() {
            var rect = Origin_editWindowRect.call(this);
            rect.width = calculateSize(rect.width, nameWindowWidth);
            rect.height = calculateSize(rect.height, nameWindowHeight);
            rect.x = calculateSize(rect.x, windowX);
            rect.y = calculateSize(rect.y, windowY);
            return rect;
        };
    
        Origin_inputWindowRect = Scene_Name.prototype.inputWindowRect;
        Scene_Name.prototype.inputWindowRect = function() {
            var rect = Origin_inputWindowRect.call(this);
            rect.width = calculateSize(rect.width, inputWindowWidth);
            rect.height = calculateSize(rect.height, inputWindowHeight);
            rect.x = calculateSize(rect.x, windowX);
            rect.y = windowY < 1 ? rect.y : windowY + this._editWindow.height + 8;
            return rect;
        };
    }());

    Или можно скачать файл тут.

    Лицензия
    MIT, вся ответственность на пользователе.

    Совместимость:
    Если возникнут проблемы - пишите.

    Boosty
    Последний раз редактировалось Phileas; 12.08.2023 в 03:38.
    Мои игры

    Мои плагины

    Мой Telegram-канал

    Мой Boosty



    Спойлер In my humble opinion :

    Все мои сообщения отражают лишь моё скромное мнение. Я ни в коем случае не пытаюсь кого-либо обидеть, ни на кого/что не наезжаю и ничего не навязываю. Благодарю за понимание и адекватность.

Информация о теме

Пользователи, просматривающие эту тему

Эту тему просматривают: 1 (пользователей: 0 , гостей: 1)

Метки этой темы

Социальные закладки

Социальные закладки

Ваши права

  • Вы не можете создавать новые темы
  • Вы не можете отвечать в темах
  • Вы не можете прикреплять вложения
  • Вы не можете редактировать свои сообщения
  •  
[MZ] Phileas_NameInputWindowRectSettings